package com.chainyoung.component_tmperson.ui.mvp.model;

import com.chainyoung.common.appcommon.entity.CommonList;
import com.chainyoung.common.di.scope.ActivityScope;
import com.chainyoung.common.integration.IRepositoryManager;
import com.chainyoung.common.mvp.BaseModel;
import com.chainyoung.common.utils.RxUtils;
import com.chainyoung.component_tmperson.api.PersonService;
import com.chainyoung.component_tmperson.entity.Purse;
import com.chainyoung.component_tmperson.ui.mvp.contract.WalletContact;
import com.chainyoung.component_tmperson.ui.mvp.contract.WithDrawContact;

import java.util.TreeMap;

import javax.inject.Inject;

import io.reactivex.Flowable;

@ActivityScope
public class WithDrawModel extends BaseModel implements WithDrawContact.Model {

    @Inject
    WithDrawModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);

    }



    @Override
    public Flowable<String> withDraw(TreeMap<String, Object> map) {
        return mRepositoryManager.obtainRetrofitService(PersonService.class)
                .withDraw(map)
                .compose(RxUtils.<String>handleResult());
    }

    @Override
    public Flowable<String> getSendCode(TreeMap<String, Object> map) {
        return mRepositoryManager.obtainRetrofitService(PersonService.class)
                .sendCode(map)
                .compose(RxUtils.<String>handleResult());
    }
}